package com.shensi.api.admin.client.label;

import com.shensi.api.admin.client.fallback.label.TimingLabelClientFallBack;
import com.shensi.api.admin.domian.label.dto.TimingLabelDto;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = TimingLabelClientFallBack.class)
@Component
public interface TimingLabelClient {


    /**
     * 查询定时修改标签信息，记录列表
     */
    @GetMapping("/customer/label/list")
    @ApiOperation("删除标签规则明细")
    public TableDataInfo list(@SpringQueryMap TimingLabelDto timingLabel);

    /**
     * 导出定时修改标签信息，记录列表
     */
    @GetMapping("/customer/label/export")
    @ApiOperation("删除标签规则明细")
    public AjaxResult export(@SpringQueryMap TimingLabelDto timingLabel);

    /**
     * 获取定时修改标签信息，记录详细信息
     */
    @GetMapping(value = "/customer/label/{timeId}")
    public AjaxResult getInfo(@PathVariable("timeId") Long timeId);

    /**
     * 新增定时修改标签信息，记录
     */
    @PostMapping("/customer/label")
    public AjaxResult add(@RequestBody TimingLabelDto timingLabel);

    /**
     * 修改定时修改标签信息，记录
     */
    @PutMapping("/customer/label")
    public AjaxResult edit(@RequestBody TimingLabelDto timingLabel);

    /**
     * 删除定时修改标签信息，记录
     */
    @DeleteMapping("/customer/label/{timeIds}")
    public AjaxResult remove(@PathVariable("timeIds") Long[] timeIds);
}
